/*
Add Column LastUpdate in table balades_Feed
*/

if not exists
(
	SELECT TOP 1 1 
	FROM INFORMATION_SCHEMA.COLUMNS
	WHERE TABLE_NAME = N'balades_Feed'
	AND COLUMN_NAME = N'LastUpdate'
)
begin
	alter table balades_Feed
	add LastUpdate datetime null
end

/****** Object:  Table [dbo].[balades_FeedItem]    Script Date: 03/17/2012 14:26:25 ******/
CREATE TABLE [dbo].[balades_FeedItem](
	[FeedItemId] [int] IDENTITY(1,1) NOT NULL,
	[FeedId] [int] NOT NULL,
	[Title] [varchar](200) NULL,
	[Summary] [varchar](max) NULL,
	[PublishedDate] [datetime] NULL,
	[Url] [varchar](200) NULL,
 CONSTRAINT [PK_balades_FeedItem] PRIMARY KEY CLUSTERED 
(
	[FeedItemId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


GO

ALTER TABLE [dbo].[balades_FeedItem]  WITH CHECK ADD  CONSTRAINT [FK_balades_FeedItem_balades_Feed] FOREIGN KEY([FeedId])
REFERENCES [dbo].[balades_Feed] ([FeedId])
GO

ALTER TABLE [dbo].[balades_FeedItem] CHECK CONSTRAINT [FK_balades_FeedItem_balades_Feed]
GO


